﻿namespace Mathematics.Expressions
{
    public sealed class Constant : MathExpression
    {
        public Constant(ExpressionValue value)
        {
            Value = value;
        }

        public ExpressionValue Value { get; private set; }

        public override string ToString()
        {
            return Value.ToString();
        }


        public override ExpressionValue Evaluate()
        {
            return Value;
        }

        public override bool CanEvaluate()
        {
            return true;
        }

        protected internal override MathExpression Reduce(out bool didReduce)
        {
            didReduce = false;
            return this;
        }

        
    }
}
